import 'package:flutter/material.dart';

class GoodEditPage extends StatelessWidget {
  const GoodEditPage({Key? key}) : super(key: key);

  double _screenWidth(BuildContext context) {
    return MediaQuery.of(context).size.width;
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: null,
        body: Container(
          decoration: const BoxDecoration(
              image: DecorationImage(
                  image: AssetImage("images/icon_gezi_bottom.png"),
                  repeat: ImageRepeat.repeat)),
          child: Column(
            children: [
              SizedBox(height: 50),
              Stack(
                children: [
                  Padding(
                    padding: EdgeInsets.fromLTRB(15, 5, 0, 0),
                    child: Align(
                      alignment: Alignment.centerLeft,
                      child: IconButton(
                          onPressed: (){
                            Navigator.pop(context,[]);
                          },
                          icon: Icon(Icons.close)
                      ),
                    ),
                  ),
                  Align(
                    alignment: Alignment.center,
                    child: Text(
                      "编辑好事",
                      style: TextStyle(
                        fontSize: 16,
                      ),
                    ),
                  ),
                  Padding(
                    padding: EdgeInsets.fromLTRB(15, 5, 0, 0),
                    child: Align(
                      alignment: Alignment.centerRight,
                      child: Icon(Icons.save),
                    ),
                  ),
                ],
              ),
              SizedBox(
                height: 20,
              ),
              Container(
                decoration: const ShapeDecoration(
                    color: Color(0xFFF8F0EB),
                    shape: RoundedRectangleBorder(
                        borderRadius: BorderRadius.all(Radius.circular(20)))),
                padding: const EdgeInsets.fromLTRB(20, 5, 20, 20),
                margin: const EdgeInsets.fromLTRB(20, 5, 20, 0),
                child: Column(
                  children: [
                    const SizedBox(
                      height: 20,
                    ),
                    Row(
                      children: [
                        const Padding(
                            padding: EdgeInsets.fromLTRB(0, 0, 5, 0),
                            child: Text("1", style: TextStyle(fontSize: 25))),
                        Column(
                          children: const [
                            Text("星期三", style: TextStyle(fontSize: 10)),
                            Text("2023/11", style: TextStyle(fontSize: 10))
                          ],
                        ),
                        const Spacer(),
                        const Text("十月初四")
                      ],
                    ),
                    SizedBox(
                      height: 20,
                    ),
                    Row(
                      children: [
                        const Align(
                          alignment: Alignment.topCenter,
                          child: Icon(Icons.format_quote),
                        ),
                        Container(
                            constraints: BoxConstraints(
                              maxHeight: 150,
                              minHeight: 50,
                              maxWidth: _screenWidth(context) - 105,
                              minWidth: 100
                            ),
                            child: TextField(
                              keyboardType: TextInputType.multiline,
                              maxLines: null,
                              decoration: InputDecoration(
                                  border: InputBorder.none, hintText: "这是提示"),
                            )),
                      ],
                    ),
                  ],
                ),
              )
            ],
          ),
        ));
  }
}
